package com.example.basic.demos.service.impl;

import com.example.basic.demos.entity.User;
import com.example.basic.demos.mapper.UserMapper;
import com.example.basic.demos.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

// 这个注解不能忘记, 要不找不到这个类
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAll() {
        return userMapper.getAll();
    }

    @Override
    public User getOne(Integer id) {
        return userMapper.getOne(id);
    }

    @Override
    public Integer insert(User user) {
        return userMapper.insertUser(user);
    }
}
